<?php include load_template('_subnav.php') ?>
<h1>Viewing a Lead</h1>

<?php

    if ( !empty($lead) )
    {
?>
    <div class='section'>
    <h2><?php echo  h($lead['first_name']) ?> <?php echo  h($lead['last_name']) ?></h2>

    <ul>
        <li><b>Submitted via form:</b> <?php echo  h($lead['form_name']) ?> on <?php echo  date_format($lead['created'],'%D %r') ?></li>
        <li><b>Email:</b> <a href='mailto:<?php echo  h($lead['email']) ?>'><?php echo  h($lead['email']) ?></a></li>
        <li><b>Phone:</b> <?php echo  h($lead['phone']) ?></li>
    </ul>
    <h3>Posted Form Contents</h3>
    <div style='width:300px;'>
    <pre>
       <?php echo  wordwrap(h($lead['form_message'])) ?>
    </pre>
    </div>
    </div>
    <br>
    <div class='section'>
        <form method='get' action='/admin/inbox/download_leads' style='display:inline'><input type='hidden' name='id' value='<?php echo $lead['id'] ?>' /><input type='submit' value='Download CSV' class='submit'  /></form><form method='post' action='/admin/inbox/delete_lead' style='display:inline'><input type='hidden' name='id' value='<?php echo $lead['id'] ?>' /><input type='submit' value='Delete Lead' class='submit_delete' onclick="return delete_confirm('at-1')" /></form>
    </div>
<?php        
    } else {
        echo "<p>No lead found</p>";
    }

?>